home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Utilities Experience
/
The Utilities Experience - Volume 1.iso
/
software
/
demos
/
r-z
/
twistdemo
/
aminet
/
addtoftpgetlist.rexx
next >
Wrap
OS/2 REXX Batch file
|
1995-03-27
|
2KB
|
111 lines
/**
* $Id$
*
*
* Add to get list
* Copyright © 1995 HiSoft Systems. All Rights Reserved.
**/
ADDLIB('rexxsupport.library',0,-30,0)
OPTIONS RESULTS
ADDRESS Twist
PARSE ARG dbfilename,rela_x,rela_y,shiftkeys
OPEN dbfilename
DBLENGTH = LENGTH(dbfilename)
do n = 1 to DBLENGTH by 1
X = right(dbfilename,n)
Y = Substr(X,1,1)
IF Y = "/" then do
FTPDBLOCATION = left(dbfilename,DBLENGTH-n) || '/AminetSites.DB'
n = DBLENGTH
END
end
GETDBFORMFIELD "FileName"
ARCHIVENAME = result
GETDBFORMFIELD "Dir"
ARCHIVEDIR = result
GETDBFORMFIELD "FTP_BBS"
FTPSITE = result
IF FTPSITE = "" then
do
IF exists('ENV:LastAminetFTP') = 1 then
do
Open(input, 'ENV:LastAminetFTP', R)
FTPSITE = Readln(input)
Close(input)
END
ELSE
do
EXIT
END
END
ELSE
do
Open(output,'ENVARC:LastAminetFTP',W)
Writeln(output,FTPSITE)
Close(output)
Open(output,'ENV:LastAminetFTP',W)
Writeln(output,FTPSITE)
Close(output)
END
OPEN FTPDBLOCATION
'SELECTALL WHERE "FTP_Name == \"' || FTPSITE ||'\""',
'STEM FTPPATH'
FTPSITEPATH = FTPPATH.Aminet_Path
FTPFILEPATH = 'ftp://' || FTPSITE || '/' || FTPSITEPATH || ARCHIVEDIR || '/' || ARCHIVENAME
IF exists('ENVARC:AminetFTPGetList') = 1 then
do
Open(output,'ENVARC:AminetFTPGetList',A)
Writeln(output,FTPFILEPATH)
Close(output)
Open(output,'ENV:AminetFTPGetList',A)
Writeln(output,FTPFILEPATH)
Close(output)
END
ELSE
DO
Open(output,'ENVARC:AminetFTPGetList',W)
Writeln(output,FTPFILEPATH)
Close(output)
Open(output,'ENV:AminetFTPGetList',W)
Writeln(output,FTPFILEPATH)
Close(output)
END
Open(input,'ENV:AminetFTPGetList',R)
FTPDATA = Readch(input,4096)
Close(input)
IF Exists('ENV:AminetFTPGetList') = 1 then
DO
ADDRESS COMMAND 'sort ENV:AminetFTPGetList ENV:SortedAminetFTPGetList'
ADDRESS COMMAND 'sort ENVARC:AminetFTPGetList ENVARC:SortedAminetFTPGetList'
END